<?php
/**
 * Created by PhpStorm.
 * User: Antique
 * Date: 2021/12/4
 * Time: 下午 09:08
 */
namespace work;
?>
<!!DOCTYPE html>
<html>
<style>
    .zzc{
        width: 100px;
		height: 100px;
		background-color: #2120ff;
		display: flex;
		justify-content: center;
        /*padding: 400px;*/
		overflow: hidden;
		/*position: relative;*/
    }


</style>
<head>
    <form id="form1" action="part/main_.php" method="post" enctype="multipart/form-data">
        姓名:<br>
        <input type="" name="username" id="ipt1" value=""/>
        <br>
		 <br>
		特长：<br />
		<select name="good">
			<option value="">C#</option>
			<option value="">Java</option>
			<option value="">PHP</option>
			<option value="">Js</option>
			<option value="">MySql</option>
		</select>
		<br>
		 <br>
		性别:<br>
		男<input type="radio" name="sex" id="" value="0" />
		女<input type="radio" name="sex" id="" value="1" />
		 <br>
		<br>
        头像：<br>
        <input type="file" id="ipt2" name="head_img[]" />
        <br>
		<br>
        <img src="" id="img1"/>
		<br>
        <button type="button" onclick="change_head_img()">设置头像</button>
        <div id="div1" ></div>
		<br>
		<br>
        <input type="submit" value="提交"/>
    </form>
</head>
<script type="text/javascript">
	var form_=document.getElementById('ipt2');
	var img_=document.getElementById('img1');
	onload=function(){
		form_.onchange=showImg;
	}
	function showImg(){
		var files=form_['files'];
		var url=window.URL || window.webkitURL;
		var imgurl=url.createObjectURL(files[0]);
		img_.src=imgurl;
		img_.style.width='200px';
	}
	function change_head_img(){
document.getElementById('div1').className='zzc';
    }
</script>
</html>












































